package test;

import java.util.*;

public class Set<I extends Number> {


    public static void  main(String[] arg0)
    {
        System.out.println(reverse(1534236469));
    }
    public static int[] twoSum(int[] nums, int target) {

        Map<Integer,Integer> map=new HashMap<>();

        for (int i=0;i<nums.length;i++)
        {
           int numb= target-nums[i];
            if (map.containsKey(numb))
            {
                 return new int[]{map.get(numb),i};
            }else {
                map.put(nums[i], i);
            }
        }

        return null;
    }

    public static int reverse(int x) {
        String xx = String.valueOf(x);
        if (x<0) {
           xx=xx.split("-")[1];
        }
        char[] chars = xx.toCharArray();
            Stack<Object> stack = new Stack<>();
            String xxx = "";
        for (int i=0;i<chars.length;i++)
        {
            stack.push(chars[i]);
        }
        for (int j=0;j<chars.length;j++)
        {
            xxx+=stack.pop();
        }


        return    x>0?Integer.valueOf(xxx):-(Integer.valueOf(xxx));
    }



}
